var columns = [
    {field: 'id',title: '序号',
        formatter:function(value, row, index){
            return index + 1 + (row.pageNumber-1)*row.pageSize;
        }
    },
    //{field: 'id',title: '序号'},
    {field: 'signerId',title: '签到人ID'},
    {field: 'trueName',title: '签到人'},
    {field: 'studentId',title: '学生ID'},
    {field: 'studentName',title: '学生名称'},
    {field: 'lessonId',title: '课程ID'},
    {field: 'lessonName',title: '课程名称'},
    {field: 'scheduleId',title: '课表ID'},
    {field: 'lessonNumber',title: '课表名称'},
    {field: 'createTime',title: '签到时间'},
    {field: 'status',title: '签到状态',class:'col-width-state',
        formatter: function (value, row) {
              return pubForm.getStatus(row);
        }
    }];

var sign={
     init:function() {
         var signerId = $("#signerId").val();
         var studentId = $("#studentId").val();
         var lessonId = $("#lessonId").val();
         var scheduleId = $("#scheduleId").val();
         var status = $("#status").val();
         var startTime = $("#startTime").val();
         var endTime = $("#endTime").val();
         var parmsObj = {};
         parmsObj.signerId=signerId;
         parmsObj.studentId=studentId;
         parmsObj.lessonId=lessonId;
         parmsObj.scheduleId=scheduleId;
         parmsObj.status=status;
         parmsObj.startTime=startTime;
         parmsObj.endTime=endTime;
         pubForm.getBootTable("#tableSignList","/base/sign/querySignList?signerId="+signerId+"&studentId="+studentId+"&status="+status+"&lessonId="+lessonId+"&scheduleId="+scheduleId+"&startTime="+startTime+"&endTime="+endTime,null,parmsObj);
     },
    refreshTabel:function () {
        var size = $(".page-size").text();
        var signerId = $("#signerId").val();
        var studentId = $("#studentId").val();
        var lessonId = $("#lessonId").val();
        var scheduleId = $("#scheduleId").val();
        var status = $("#status").val();
        var startTime = $("#startTime").val();
        var endTime = $("#endTime").val();
        var opt = {
            url: application.contextPath + "/base/sign/querySignList",
            query: {
                size: size,
                page: 1,
                signerId:signerId,
                studentId:studentId,
                status:status,
                lessonId:lessonId,
                scheduleId:scheduleId,
                startTime:startTime,
                endTime:endTime
            },
            silent: true
        };
        $("#tableSignList").bootstrapTable('refreshOptions',opt);
    },
    querySignByMap:function () {
        var data = {};
        var size = $(".page-size").text();
        var signerId = $("#signerId").val();
        var studentId = $("#studentId").val();
        var lessonId = $("#lessonId").val();
        var scheduleId = $("#scheduleId").val();
        var status = $("#status").val();
        var startTime = $("#startTime").val();
        var endTime = $("#endTime").val();
        var parmsObj = {};
        parmsObj.signerId=signerId;
        parmsObj.studentId=studentId;
        parmsObj.lessonId=lessonId;
        parmsObj.scheduleId=scheduleId;
        parmsObj.status=status;
        parmsObj.startTime=startTime;
        parmsObj.endTime=endTime;

        var opt = {
            url: application.contextPath + "/base/sign/querySignList?signerId="+signerId+"&studentId="+studentId+"&status="+status+"&lessonId="+lessonId+"&scheduleId="+scheduleId+"&startTime="+startTime+"&endTime="+endTime,
            query: {
                size: size,
                page: 1
            },
            silent: true
        };
        $('#tableSignList').bootstrapTable('refreshOptions', opt);

    }
};

$(document).ready(function(){
    sign.init();
});